<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
 
// import Joomla controllerform library
jimport('joomla.application.component.controllerform');
 
/**
 * HelloWorld Controller
 */
class ShopControllerOrder extends JControllerForm
{

	public function save()
	{
		$user		= JFactory::getUser();
		$db =& JFactory::getDBO();
		JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR . '/tables');
		$row = JTable::getInstance('Order','ShopTable');
		$row->reorder();
		$row->bind(JRequest::get('post'));
		$row->ordering = 1;
		///--- insert new params
		$row->desc = JRequest::getVar( 'desc', '', 'post', 'string', JREQUEST_ALLOWRAW );
		$row->datestart = strtotime(JRequest::getVar('datestart'));
		$row->dateend = strtotime(JRequest::getVar('dateend'));
		

		if($row->store())
		{
			$this->setMessage('Cập nhật banner quản cáo thành công');
			$this->setRedirect('index.php?option=com_shop&view=orderes');
		}
		else
		{
			$this->setMessage('Lỗi cập nhật banner quản cáo');
			$this->setRedirect('index.php?option=com_shop&view=orderes');
		}
	}
}
